import React from "react";
import { Outlet } from "react-router-dom";
import { Button } from "antd";
import { useNavigate } from "react-router-dom";
import { useDispatch } from "react-redux";
import { addRoutes } from "../../config/store";
const Catetory: React.FC = () => {
  const navigate = useNavigate();
  const dispatch = useDispatch();
  return (
    <div>
      <Button
        type="primary"
        onClick={() => {
          console.log("d");
        }}
      >
        Catetory
      </Button>
      <Button
        type="primary"
        onClick={() => {
          dispatch(addRoutes([{ path: "/added", element: <div>added</div> }]));
        }}
      >
        添加route
      </Button>
      <Button
        type="primary"
        onClick={() => {
          navigate('/added')
        }}
      >
        跳转到添加的上面
      </Button>
    </div>
  );
};
export default Catetory;
